from django.urls import path
from .views import (
    ArticleCreateView,
    ArticleListView,
    ArticleDetailView,
    ArticleSearchView,
    BlogArticleListView,
    BlogArticleDetailView
)

urlpatterns = [
    # 管理后台接口
    path('admin/create/', ArticleCreateView.as_view(), name='article_create'),
    path('admin/getall/', ArticleListView.as_view(), name='article_list'),
    path('admin/get/<int:pk>/', ArticleDetailView.as_view(), name='article_detail_get'),
    path('admin/update/', ArticleDetailView.as_view(), name='article_detail_update'),
    path('admin/delete/<int:pk>/', ArticleDetailView.as_view(), name='article_detail_delete'),
    path('admin/search/', ArticleSearchView.as_view(), name='article_search'),

    # 博客前端接口
    path('blog/articles/', BlogArticleListView.as_view(), name='blog_article_list'),
    path('blog/articles/category/<int:category_id>/', BlogArticleListView.as_view(), name='blog_article_by_category'),
    path('blog/articles/tag/<int:tag_id>/', BlogArticleListView.as_view(), name='blog_article_by_tag'),
    path('blog/article/<int:pk>/', BlogArticleDetailView.as_view(), name='blog_article_detail'),
]